home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / demos / video / callbacks.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  45.2 KB  |  1,785 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /*
  18.  * callbacks.c  - callback routines for videofx program
  19.  * 
  20.  * some of this code was 
  21.  * generated by the ICS builderXcessory (BX).
  22.  * Builder Xcessory 3.0 FT.
  23.  *
  24.  */
  25.  
  26. #include "callbacks.h"
  27. #include "creation.h"  
  28.  
  29. /* globals */
  30. int    SwitchType;
  31. int    repeatfactor = 60;
  32. int    speedfactor = 50;
  33. int    fuzzfactor = 100;
  34.  
  35. /* #define DEBUG    1 */
  36.  
  37. void getAllChromaVLValues(vals) 
  38. /* returns slider values for widgets obtained using vlGetControls */
  39. int *vals;
  40. {
  41.         VLControlValue vlgotval;
  42.         int range, val, min, max;
  43.  
  44.     vlGetControl(vlSvr, vlPath, blend_node, 
  45.         VL_EV1_KEYER_RANGE_CHROMA_U, &vlgotval);
  46.     range = vlgotval.intVal;
  47.     vlGetControl(vlSvr, vlPath, blend_node,
  48.         VL_EV1_KEYER_VALUE_CHROMA_U, &vlgotval);
  49.     val = vlgotval.intVal;
  50.     rangevaltominmax(range, val, &min, &max);
  51.     vals[0] = min; 
  52.     vals[1] = max;
  53.     vlGetControl(vlSvr, vlPath, blend_node,
  54.         VL_EV1_KEYER_RANGE_CHROMA_V, &vlgotval);
  55.     range = vlgotval.intVal;
  56.     vlGetControl(vlSvr, vlPath, blend_node,
  57.         VL_EV1_KEYER_VALUE_CHROMA_V, &vlgotval);
  58.     val = vlgotval.intVal;
  59.     rangevaltominmax(range, val, &min, &max);
  60.     vals[2] = min;
  61.     vals[3] = max;
  62.     vlGetControl(vlSvr, vlPath, blend_node,
  63.        VL_EV1_KEYER_DETAIL, &vlgotval);
  64.     vals[4] = vlgotval.intVal;
  65. }
  66. void getAllLumaVLValues(vals) /* returns slider values for widgets */
  67. int *vals;
  68. {
  69.         VLControlValue vlgotval;
  70.         int range, val, min, max;
  71.  
  72.     vlGetControl(vlSvr, vlPath, blend_node,
  73.         VL_EV1_KEYER_RANGE_LUMA, &vlgotval);
  74.     range = vlgotval.intVal;
  75.     vlGetControl(vlSvr, vlPath, blend_node, 
  76.         VL_EV1_KEYER_VALUE_LUMA, &vlgotval);
  77.     val = vlgotval.intVal;
  78.     rangevaltominmax(range, val, &min, &max);
  79.     vals[0] = min; 
  80.     vals[1] = max;
  81.     vlGetControl(vlSvr, vlPath, blend_node, 
  82.         VL_EV1_KEYER_DETAIL, &vlgotval);
  83.     vals[2] = vlgotval.intVal;
  84.     vlGetControl(vlSvr, vlPath, blend_node, 
  85.         VL_EV1_KEYER_FG_OPACITY, &vlgotval);
  86.     vals[3] = vlgotval.intVal;
  87. }
  88.  
  89. void setAllLumaVLValues(vals) /* returns slider values for widgets */
  90. int *vals;
  91. {
  92.     VLControlValue vlctlval;
  93.     int range, val, min, max;
  94.  
  95.     minmaxtorangeval(vals[0],vals[1],&range,&val);
  96.     vlctlval.intVal = range;
  97.     vlSetControl(vlSvr, vlPath, blend_node,
  98.         VL_EV1_KEYER_RANGE_LUMA, &vlctlval);
  99.     vlctlval.intVal = val;
  100.     vlSetControl(vlSvr, vlPath, blend_node, 
  101.         VL_EV1_KEYER_VALUE_LUMA, &vlctlval);
  102.     vlctlval.intVal = vals[2];
  103.     vlSetControl(vlSvr, vlPath, blend_node, 
  104.         VL_EV1_KEYER_DETAIL, &vlctlval);
  105.     vlctlval.intVal = vals[3];
  106.     vlSetControl(vlSvr, vlPath, blend_node, 
  107.         VL_EV1_KEYER_FG_OPACITY, &vlctlval);
  108. }
  109.  
  110. /* slider behavior functions */
  111. void getAllChromaScaleValues(vals)
  112. int *vals;
  113. {
  114.         XmScaleGetValue(UminScale,&vals[0]);
  115.         XmScaleGetValue(UmaxScale,&vals[1]);
  116.         XmScaleGetValue(VminScale,&vals[2]);
  117.         XmScaleGetValue(VmaxScale,&vals[3]);
  118.         XmScaleGetValue(ChromasharpScale,&vals[4]);
  119. #ifdef DEBUG
  120.         printf("getAll chromas: %d %d %d %d %d\n", vals[0], 
  121.             vals[1], vals[2], vals[3], vals[4]);
  122. #endif
  123. }
  124. void getAllLumaScaleValues(vals)
  125. int *vals;
  126. {
  127.         XmScaleGetValue(YminScale,&vals[0]);
  128.         XmScaleGetValue(YmaxScale,&vals[1]);
  129.         XmScaleGetValue(LumasharpScale,&vals[2]);
  130.         XmScaleGetValue(LumafgopScale,&vals[3]);
  131. }
  132.  
  133. void setAllChromaScaleValues(vals)
  134. int *vals;
  135. {
  136.         char thestring[5];
  137.         
  138. #ifdef DEBUG
  139.         printf("inside setAllChromaScaleValues\n");
  140.         printf("setAll chromas: %d %d %d %d %d\n", vals[0], 
  141.             vals[1], vals[2], vals[3], vals[4]);
  142. #endif 
  143.  
  144.         XmScaleSetValue(UminScale,vals[0]);
  145.         itoa(vals[0], thestring);
  146.         XmTextFieldSetString(UminTF,thestring);  
  147.  
  148.         XmScaleSetValue(UmaxScale,vals[1]);
  149.         itoa(vals[1], thestring);
  150.         XmTextFieldSetString(UmaxTF,thestring);  
  151.  
  152.         XmScaleSetValue(VminScale,vals[2]);
  153.         itoa(vals[2], thestring);
  154.         XmTextFieldSetString(VminTF,thestring);  
  155.  
  156.         XmScaleSetValue(VmaxScale,vals[3]);
  157.         itoa(vals[3], thestring);
  158.         XmTextFieldSetString(VmaxTF,thestring);  
  159.  
  160.         XmScaleSetValue(ChromasharpScale,vals[4]);
  161.         itoa(vals[4], thestring);
  162.         XmTextFieldSetString(ChromasharpTF,thestring);  
  163.  
  164.         /* if this routine is used other than w/presets */
  165.         /* careful w/the following TB code: */
  166.  
  167.         /* set lock TB modes to off */
  168.         XmToggleButtonSetState(UrangelockTB, False, True);
  169.         XmToggleButtonSetState(VrangelockTB, False, True);
  170. }
  171.  
  172. void setAllLumaScaleValues(vals)
  173. int *vals;
  174. {
  175.         char thestring[5];
  176.         
  177.         XmScaleSetValue(YminScale,vals[0]);
  178.         itoa(vals[0], thestring);
  179.         XmTextFieldSetString(YminTF,thestring);  
  180.  
  181.         XmScaleSetValue(YmaxScale,vals[1]);
  182.         itoa(vals[1], thestring);
  183.         XmTextFieldSetString(YmaxTF,thestring);  
  184.  
  185.         XmScaleSetValue(LumasharpScale,vals[2]);
  186.         itoa(vals[2], thestring);
  187.         XmTextFieldSetString(LumasharpTF,thestring);  
  188.  
  189.         XmScaleSetValue(LumafgopScale,vals[3]);
  190.         itoa(vals[3], thestring);
  191.         XmTextFieldSetString(LumafgopTF,thestring);  
  192.  
  193.         /* set lock TB modes to off */
  194.         XmToggleButtonSetState(YrangelockTB, False, True);
  195. }
  196.  
  197. void dochroma(op)
  198. int op;
  199. {
  200.     VLControlValue vlctlval;
  201.     VLControlValue vlgotval;
  202.  
  203.     int gotvals[5];    
  204.     int range, value;
  205.  
  206. /*    getAllChromaScaleValues(&gotvals); */
  207.  
  208.    vlctlval.intVal = VL_EV1_KEYERMODE_CHROMA;
  209.    vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_KEYER_MODE, &vlctlval);
  210.  
  211.    if ((op == DO_U) || (op == DO_ALL))
  212.    {
  213.      XmScaleGetValue(UminScale,&gotvals[0]);
  214.      XmScaleGetValue(UmaxScale,&gotvals[1]);
  215.  
  216.      minmaxtorangeval(gotvals[0], gotvals[1], &range, &value);
  217.      vlctlval.intVal = range;
  218.      vlSetControl(vlSvr, vlPath, blend_node,
  219.          VL_EV1_KEYER_RANGE_CHROMA_U, &vlctlval);
  220.      vlctlval.intVal = value;
  221.      vlSetControl(vlSvr, vlPath, blend_node, 
  222.          VL_EV1_KEYER_VALUE_CHROMA_U,&vlctlval);
  223.    }
  224.    if ((op == DO_V) || (op == DO_ALL))
  225.    {
  226.      XmScaleGetValue(VminScale,&gotvals[2]);
  227.      XmScaleGetValue(VmaxScale,&gotvals[3]);
  228.  
  229.      minmaxtorangeval(gotvals[2], gotvals[3], &range, &value);
  230.      vlctlval.intVal = range;
  231.      vlSetControl(vlSvr, vlPath, blend_node, 
  232.           VL_EV1_KEYER_RANGE_CHROMA_V, &vlctlval);
  233.      vlctlval.intVal = value;
  234.      vlSetControl(vlSvr, vlPath, blend_node, 
  235.          VL_EV1_KEYER_VALUE_CHROMA_V, &vlctlval);
  236.    }
  237.    /* always set detail; other operations can set this VL value, e.g. wipes */
  238.    XmScaleGetValue(ChromasharpScale,&gotvals[4]);
  239.    vlctlval.intVal = gotvals[4];
  240.    vlSetControl(vlSvr, vlPath, blend_node, 
  241.            VL_EV1_KEYER_DETAIL, &vlctlval);
  242. }
  243.  
  244. void doluma(op)
  245. int op;
  246. {
  247.     VLControlValue vlctlval;
  248.     VLControlValue vlgotval;
  249.  
  250.     int gotvals[4];
  251.     int range, value;
  252.  
  253. /*    getAllLumaScaleValues(&gotvals); */
  254.  
  255.     vlctlval.intVal = VL_EV1_KEYERMODE_LUMA;
  256.     vlSetControl(vlSvr, vlPath, blend_node, 
  257.         VL_EV1_KEYER_MODE, &vlctlval);
  258.    if ((op == DO_Y) || (op == DO_ALL))
  259.    {
  260.      XmScaleGetValue(YminScale,&gotvals[0]);
  261.      XmScaleGetValue(YmaxScale,&gotvals[1]);
  262.      minmaxtorangeval(gotvals[0], gotvals[1], &range, &value);
  263.      vlctlval.intVal = range;
  264.      vlSetControl(vlSvr, vlPath, blend_node, 
  265.          VL_EV1_KEYER_RANGE_LUMA, &vlctlval);
  266.      vlctlval.intVal = value;
  267.      vlSetControl(vlSvr, vlPath, blend_node, 
  268.          VL_EV1_KEYER_VALUE_LUMA, &vlctlval);
  269.    }
  270.  
  271.    /* always set detail; other operations can set these VL value, e.g. wipes */
  272.    XmScaleGetValue(LumasharpScale,&gotvals[2]);
  273.    vlctlval.intVal = gotvals[2];
  274.    vlSetControl(vlSvr, vlPath, blend_node, 
  275.          VL_EV1_KEYER_DETAIL, &vlctlval);
  276.    XmScaleGetValue(LumafgopScale,&gotvals[3]);
  277.    vlctlval.intVal = gotvals[3];
  278.    vlSetControl(vlSvr, vlPath, blend_node, 
  279.          VL_EV1_KEYER_FG_OPACITY, &vlctlval);
  280. }
  281.  
  282. void
  283. uminScaleHandler(w, client, call)
  284. Widget w;
  285. XtPointer client;
  286. XtPointer call;
  287. {
  288.     XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
  289.     VLControlValue vlctlvalue;
  290.     int  minsetval;
  291.     int  maxsetval;
  292.     int  mingotval;
  293.     int  maxgotval;
  294.     char thestring[5];
  295.  
  296.     minsetval = cs->value;
  297.     if (Urangelock){
  298.         /* if umax hits upper bound, restrict umin */
  299.         if ((cs->value + Urangelockval) > UMAX_VAL){
  300.         minsetval = UMAX_VAL - Urangelockval;
  301.         XmScaleSetValue(UminScale, minsetval);
  302.         }
  303.         maxsetval = minsetval + Urangelockval;
  304.         XmScaleSetValue(UmaxScale, maxsetval);
  305.         itoa(maxsetval, thestring);
  306.         XmTextFieldSetString(UmaxTF,thestring);  
  307.     } else
  308.     {
  309.         /* min should not be > max */
  310.         /* if min is going past max, push the max up */
  311.         XmScaleGetValue(UmaxScale, &maxgotval);
  312.         if (minsetval > maxgotval){
  313.         XmScaleSetValue(UmaxScale, minsetval);
  314.         itoa(minsetval, thestring);
  315.         XmTextFieldSetString(UmaxTF,thestring);  
  316.         } else {
  317.         /* empty */
  318.         }
  319.     } /* end if Urangelock */
  320.  
  321.     itoa(minsetval, thestring);
  322.         XmTextFieldSetString(UminTF,thestring);  
  323.     dochroma(DO_U);
  324. }
  325.  
  326. void
  327. chromaBBdestroyHandler(w, client, call)
  328. Widget w;
  329. XtPointer client;
  330. XtPointer call;
  331. {
  332.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  333.     Arg args[256];
  334.     Cardinal argcnt;
  335.     Boolean argok;
  336.  
  337.     Shell001 = CreatechromaShell(AppShell);
  338.     ChromaBBoard = CreatechromaBBoard(Shell001);
  339.  
  340. }
  341.  
  342. void
  343. lumaBBdestroyHandler(w, client, call)
  344. Widget w;
  345. XtPointer client;
  346. XtPointer call;
  347. {
  348.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  349.     Arg args[256];
  350.     Cardinal argcnt;
  351.     Boolean argok;
  352.  
  353.     Shell002 = CreatelumaShell(AppShell);
  354.     LumaBBoard = CreatelumaBBoard(Shell002);
  355.  
  356. }
  357.  
  358. void
  359. switchBBdestroyHandler(w, client, call)
  360. Widget w;
  361. XtPointer client;
  362. XtPointer call;
  363. {
  364.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  365.     Arg args[256];
  366.     Cardinal argcnt;
  367.     Boolean argok;
  368.  
  369.     Shell003 = CreateswitchShell(AppShell);
  370.     SwitchBBoard = CreateswitchBBoard(Shell003);
  371. }
  372.  
  373. void
  374. umaxScaleHandler(w, client, call)
  375. Widget w;
  376. XtPointer client;
  377. XtPointer call;
  378. {
  379.     XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
  380.     VLControlValue vlctlvalue;
  381.     int  minsetval;
  382.     int  maxsetval;
  383.     int  mingotval;
  384.     int  maxgotval;
  385.     char thestring[5];
  386.  
  387.     maxsetval = cs->value;
  388.     if (Urangelock){
  389.         /* if umin hits lower bound, restrict umax */
  390.         if ((cs->value - Urangelockval) < UMIN_VAL){
  391.         maxsetval = UMIN_VAL + Urangelockval;
  392.         XmScaleSetValue(UmaxScale, maxsetval);
  393.         }
  394.         minsetval = maxsetval - Urangelockval;
  395.         XmScaleSetValue(UminScale, minsetval);
  396.         itoa(minsetval, thestring);
  397.         XmTextFieldSetString(UminTF,thestring);  
  398.     } else
  399.     {
  400.         /* max should not be < min */
  401.         /* if max is going below min, push the min down */
  402.         XmScaleGetValue(UminScale, &mingotval);
  403.         if (maxsetval < mingotval){
  404.         XmScaleSetValue(UminScale, maxsetval);
  405.         itoa(maxsetval, thestring);
  406.         XmTextFieldSetString(UminTF,thestring);  
  407.         } else {
  408.         /* empty */
  409.         }
  410.     } /* end if Urangelock */
  411.     itoa(maxsetval, thestring);
  412.         XmTextFieldSetString(UmaxTF,thestring);  
  413.     dochroma(DO_U);
  414. }
  415.  
  416. void
  417. vminScaleHandler(w, client, call)
  418. Widget w;
  419. XtPointer client;
  420. XtPointer call;
  421. {
  422.     XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
  423.     VLControlValue vlctlvalue;
  424.     int  minsetval;
  425.     int  maxsetval;
  426.     int  mingotval;
  427.     int  maxgotval;
  428.     char thestring[5];
  429.  
  430.     minsetval = cs->value;
  431.     if (Vrangelock){
  432.         /* if vmax hits upper bound, restrict vmin */
  433.         if ((cs->value + Vrangelockval) > VMAX_VAL){
  434.         minsetval = VMAX_VAL - Vrangelockval;
  435.         XmScaleSetValue(VminScale, minsetval);
  436.         }
  437.         maxsetval = minsetval + Vrangelockval;
  438.         XmScaleSetValue(VmaxScale, maxsetval);
  439.         itoa(maxsetval, thestring);
  440.         XmTextFieldSetString(VmaxTF,thestring);  
  441.     } else
  442.     {
  443.         /* min should not be > max */
  444.         /* if min is going past max, push the max up */
  445.         XmScaleGetValue(VmaxScale, &maxgotval);
  446.         if (minsetval > maxgotval){
  447.         XmScaleSetValue(VmaxScale, minsetval);
  448.         itoa(minsetval, thestring);
  449.         XmTextFieldSetString(VmaxTF,thestring);  
  450.         } else {
  451.         /* empty */
  452.         }
  453.     } /* end if Vrangelock */
  454.  
  455.     itoa(minsetval, thestring);
  456.         XmTextFieldSetString(VminTF,thestring);  
  457.     dochroma(DO_V);
  458. }
  459.  
  460. void
  461. vmaxScaleHandler(w, client, call)
  462. Widget w;
  463. XtPointer client;
  464. XtPointer call;
  465. {
  466.     XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
  467.     VLControlValue vlctlvalue;
  468.     int  minsetval;
  469.     int  maxsetval;
  470.     int  mingotval;
  471.     int  maxgotval;
  472.     char thestring[5];
  473.  
  474.     maxsetval = cs->value;
  475.     if (Vrangelock){
  476.         /* if vmin hits lower bound, restrict vmax */
  477.         if ((cs->value - Vrangelockval) < VMIN_VAL){
  478.         maxsetval = VMIN_VAL + Vrangelockval;
  479.         XmScaleSetValue(VmaxScale, maxsetval);
  480.         }
  481.         minsetval = maxsetval - Vrangelockval;
  482.         XmScaleSetValue(VminScale, minsetval);
  483.         itoa(minsetval, thestring);
  484.         XmTextFieldSetString(VminTF,thestring);  
  485.     } else
  486.     {
  487.         /* max should not be < min */
  488.         /* if max is going below min, push the min down */
  489.         XmScaleGetValue(VminScale, &mingotval);
  490.         if (maxsetval < mingotval){
  491.         XmScaleSetValue(VminScale, maxsetval);
  492.         itoa(maxsetval, thestring);
  493.         XmTextFieldSetString(VminTF,thestring);  
  494.         } else {
  495.         /* empty */
  496.         }
  497.     } /* end if Vrangelock */
  498.  
  499.  
  500.     itoa(maxsetval, thestring);
  501.         XmTextFieldSetString(VmaxTF,thestring);  
  502.     dochroma(DO_V);
  503. }
  504.  
  505.  
  506. void
  507. urangelockTBHandler(w, client, call)
  508. Widget w;
  509. XtPointer client;
  510. XtPointer call;
  511. {
  512.     XmToggleButtonCallbackStruct *cs=(XmToggleButtonCallbackStruct*)call;
  513.     int mingotval;
  514.     int maxgotval;
  515.  
  516.     if (cs->set){
  517.         Urangelock = True;
  518.         XmScaleGetValue(UmaxScale,&maxgotval);
  519.         XmScaleGetValue(UminScale,&mingotval);
  520.         Urangelockval = (maxgotval-mingotval); 
  521.     }
  522.     else{
  523.         Urangelock = False;
  524.     }
  525. }
  526. void
  527. vrangelockTBHandler(w, client, call)
  528. Widget w;
  529. XtPointer client;
  530. XtPointer call;
  531. {
  532.     XmToggleButtonCallbackStruct *cs=(XmToggleButtonCallbackStruct*)call;
  533.     int mingotval;
  534.     int maxgotval;
  535.  
  536.     if (cs->set){
  537.         Vrangelock = True;
  538.         XmScaleGetValue(VmaxScale,&maxgotval);
  539.         XmScaleGetValue(VminScale,&mingotval);
  540.         Vrangelockval = (maxgotval-mingotval); 
  541.     }
  542.     else{
  543.         Vrangelock = False;
  544.     }
  545. }
  546. void
  547. yrangelockTBHandler(w, client, call)
  548. Widget w;
  549. XtPointer client;
  550. XtPointer call;
  551. {
  552.     XmToggleButtonCallbackStruct *cs=(XmToggleButtonCallbackStruct*)call;
  553.     int mingotval;
  554.     int maxgotval;
  555.  
  556.     if (cs->set){
  557.         Yrangelock = True;
  558.         XmScaleGetValue(YmaxScale,&maxgotval);
  559.         XmScaleGetValue(YminScale,&mingotval);
  560.         Yrangelockval = (maxgotval-mingotval); 
  561.     }
  562.     else{
  563.         Yrangelock = False;
  564.     }
  565. }
  566.  
  567.  
  568. void
  569. chromasharpScaleHandler(w, client, call)
  570. Widget w;
  571. XtPointer client;
  572. XtPointer call;
  573. {
  574.     XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
  575.     VLControlValue vlctlvalue;
  576.     char thestring[5];
  577.  
  578.     itoa(cs->value, thestring);
  579.         XmTextFieldSetString(ChromasharpTF,thestring);  
  580.     dochroma(DO_DETAIL);
  581. }
  582.  
  583. void
  584. chromaDoPBHandler(w, client, call)
  585. Widget w;
  586. XtPointer client;
  587. XtPointer call;
  588. {
  589.     XmPushButtonCallbackStruct *acs=(XmPushButtonCallbackStruct*)call;
  590.     dochroma(DO_ALL);
  591. }
  592.  
  593. void
  594. chromaAPBHandler(w, client, call)
  595. Widget w;
  596. XtPointer client;
  597. XtPointer call;
  598. {
  599.     XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
  600.     if (XmToggleButtonGetState(ChromasetTB)){
  601.         /* we want to get scale values into the preset memory */
  602.         getAllChromaScaleValues(&ChromaPreA);
  603.         /* undo set state:*/
  604.         XmToggleButtonSetState(ChromasetTB, False, True);
  605.     }
  606.     else{
  607.         /* we want to set scale values according to the preset memory */
  608.         setAllChromaScaleValues(ChromaPreA);
  609.         /* set the VL controls */
  610.         dochroma(DO_ALL);
  611.     }
  612. }
  613.  
  614. void
  615. chromaBPBHandler(w, client, call)
  616. Widget w;
  617. XtPointer client;
  618. XtPointer call;
  619. {
  620.     XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
  621.     if (XmToggleButtonGetState(ChromasetTB)){
  622.         /* we want to get scale values into the preset memory */
  623.         getAllChromaScaleValues(&ChromaPreB);
  624.         /* undo set state:*/
  625.         XmToggleButtonSetState(ChromasetTB, False, True);
  626.     }
  627.     else{
  628.         /* we want to set scale values according to the preset memory */
  629.         setAllChromaScaleValues(ChromaPreB);
  630.         /* set the VL controls */
  631.         dochroma(DO_ALL);
  632.     }
  633. }
  634.  
  635. void
  636. chroma1PBHandler(w, client, call)
  637. Widget w;
  638. XtPointer client;
  639. XtPointer call;
  640. {
  641.     XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
  642.     if (XmToggleButtonGetState(ChromasetTB)){
  643.         /* we want to get scale values into the preset memory */
  644.         getAllChromaScaleValues(&ChromaPre1);
  645.         /* undo set state:*/
  646.         XmToggleButtonSetState(ChromasetTB, False, True);
  647.     }
  648.     else{
  649.         /* we want to set scale values according to the preset memory */
  650.         setAllChromaScaleValues(ChromaPre1);
  651.         /* set the VL controls */
  652.         dochroma(DO_ALL);
  653.     }
  654. }
  655.  
  656. void
  657. chroma2PBHandler(w, client, call)
  658. Widget w;
  659. XtPointer client;
  660. XtPointer call;
  661. {
  662.     XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
  663.     if (XmToggleButtonGetState(ChromasetTB)){
  664.         /* we want to get scale values into the preset memory */
  665.         getAllChromaScaleValues(&ChromaPre2);
  666.         /* undo set state:*/
  667.         XmToggleButtonSetState(ChromasetTB, False, True);
  668.     }
  669.     else{
  670.         /* we want to set scale values according to the preset memory */
  671.         setAllChromaScaleValues(ChromaPre2);
  672.         /* set the VL controls */
  673.         dochroma(DO_ALL);
  674.     }
  675. }
  676.  
  677. void
  678. chroma3PBHandler(w, client, call)
  679. Widget w;
  680. XtPointer client;
  681. XtPointer call;
  682. {
  683.     XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
  684.     if (XmToggleButtonGetState(ChromasetTB)){
  685.         /* we want to get scale values into the preset memory */
  686.         getAllChromaScaleValues(&ChromaPre3);
  687.         /* undo set state:*/
  688.         XmToggleButtonSetState(ChromasetTB, False, True);
  689.     }
  690.     else{
  691.         /* we want to set scale values according to the preset memory */
  692.         setAllChromaScaleValues(ChromaPre3);
  693.         /* set the VL controls */
  694.         dochroma(DO_ALL);
  695.     }
  696. }
  697.  
  698. void
  699. chroma4PBHandler(w, client, call)
  700. Widget w;
  701. XtPointer client;
  702. XtPointer call;
  703. {
  704.     XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
  705.     if (XmToggleButtonGetState(ChromasetTB)){
  706.         /* we want to get scale values into the preset memory */
  707.         getAllChromaScaleValues(&ChromaPre4);
  708.         /* undo set state:*/
  709.         XmToggleButtonSetState(ChromasetTB, False, True);
  710.     }
  711.     else{
  712.         /* we want to set scale values according to the preset memory */
  713.         setAllChromaScaleValues(ChromaPre4);
  714.         /* set the VL controls */
  715.         dochroma(DO_ALL);
  716.     }
  717. }
  718.  
  719. void
  720. chromasetTBHandler(w, client, call)
  721. Widget w;
  722. XtPointer client;
  723. XtPointer call;
  724. {
  725.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  726. }
  727.  
  728. void
  729. yminScaleHandler(w, client, call)
  730. Widget w;
  731. XtPointer client;
  732. XtPointer call;
  733. {
  734.     XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
  735.     VLControlValue vlctlvalue;
  736.     int  minsetval;
  737.     int  maxsetval;
  738.     int  mingotval;
  739.     int  maxgotval;
  740.     char thestring[5];
  741.  
  742.     minsetval = cs->value;
  743.     if (Yrangelock){
  744.         /* if ymax hits upper bound, restrict ymin */
  745.         if ((cs->value + Yrangelockval) > YMAX_VAL){
  746.         minsetval = YMAX_VAL - Yrangelockval;
  747.         XmScaleSetValue(YminScale, minsetval);
  748.         }
  749.         maxsetval = minsetval + Yrangelockval;
  750.         XmScaleSetValue(YmaxScale, maxsetval);
  751.         itoa(maxsetval, thestring);
  752.         XmTextFieldSetString(YmaxTF,thestring);  
  753.     } else
  754.     {
  755.         /* min should not be > max */
  756.         /* if min is going past max, push the max up */
  757.         XmScaleGetValue(YmaxScale, &maxgotval);
  758.         if (minsetval > maxgotval){
  759.         XmScaleSetValue(YmaxScale, minsetval);
  760.         itoa(minsetval, thestring);
  761.         XmTextFieldSetString(YmaxTF,thestring);  
  762.         } else {
  763.         /* empty */
  764.         }      
  765.     } /* end if Vrangelock */
  766.  
  767.     itoa(minsetval, thestring);
  768.         XmTextFieldSetString(YminTF,thestring);  
  769.     doluma(DO_Y);
  770. }
  771.  
  772. void
  773. ymaxScaleHandler(w, client, call)
  774. Widget w;
  775. XtPointer client;
  776. XtPointer call;
  777. {
  778.     XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
  779.     VLControlValue vlctlvalue;
  780.     int  minsetval;
  781.     int  maxsetval;
  782.     int  mingotval;
  783.     int  maxgotval;
  784.     char thestring[5];
  785.  
  786.     maxsetval = cs->value;
  787.     if (Yrangelock){
  788.         /* if ymin hits lower bound, restrict ymax */
  789.         if ((cs->value - Yrangelockval) < YMIN_VAL){
  790.         maxsetval = YMIN_VAL + Yrangelockval;
  791.         XmScaleSetValue(YmaxScale, maxsetval);
  792.         }
  793.         minsetval = maxsetval - Yrangelockval;
  794.         XmScaleSetValue(YminScale, minsetval);
  795.         itoa(minsetval, thestring);
  796.         XmTextFieldSetString(YminTF,thestring);  
  797.     } else
  798.     {
  799.         /* max should not be < min */
  800.         /* if max is going below min, push the min down */
  801.         XmScaleGetValue(YminScale, &mingotval);
  802.         if (maxsetval < mingotval){
  803.         XmScaleSetValue(YminScale, maxsetval);
  804.         itoa(maxsetval, thestring);
  805.         XmTextFieldSetString(YminTF,thestring);  
  806.         } else {
  807.         /* empty */
  808.         }
  809.     } /* end if Vrangelock */
  810.  
  811.  
  812.     itoa(maxsetval, thestring);
  813.         XmTextFieldSetString(YmaxTF,thestring);  
  814.     doluma(DO_Y);
  815. }
  816.  
  817. void
  818. lumasharpScaleHandler(w, client, call)
  819. Widget w;
  820. XtPointer client;
  821. XtPointer call;
  822. {
  823.     XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
  824.     VLControlValue vlctlvalue;
  825.     char thestring[5];
  826.  
  827.     itoa(cs->value, thestring);
  828.         XmTextFieldSetString(LumasharpTF,thestring);  
  829.     doluma(DO_DETAIL);
  830. }
  831.  
  832. void
  833. lumafgopScaleHandler(w, client, call)
  834. Widget w;
  835. XtPointer client;
  836. XtPointer call;
  837. {
  838.     XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
  839.     VLControlValue vlctlvalue;
  840.     char thestring[5];
  841.  
  842.     itoa(cs->value, thestring);
  843.         XmTextFieldSetString(LumafgopTF,thestring);  
  844.     doluma(DO_FGOP);
  845. }
  846.  
  847. void
  848. lumaDoHandler(w, client, call)
  849. Widget w;
  850. XtPointer client;
  851. XtPointer call;
  852. {
  853.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  854.     doluma(DO_ALL);
  855. }
  856.  
  857. void
  858. lumaAPBHandler(w, client, call)
  859. Widget w;
  860. XtPointer client;
  861. XtPointer call;
  862. {
  863.     XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
  864.     if (XmToggleButtonGetState(LumasetTB)){
  865.         /* we want to get scale values into the preset memory */
  866.         getAllLumaScaleValues(&LumaPreA);
  867.         /* undo set state:*/
  868.         XmToggleButtonSetState(LumasetTB, False, True);
  869.     }
  870.     else{
  871.         /* we want to set scale values according to the preset memory */
  872.         setAllLumaScaleValues(LumaPreA);
  873.         /* set the VL controls */
  874.         doluma(DO_ALL);
  875.     }
  876. }
  877.  
  878. void
  879. lumaBPBHandler(w, client, call)
  880. Widget w;
  881. XtPointer client;
  882. XtPointer call;
  883. {
  884.     XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
  885.     if (XmToggleButtonGetState(LumasetTB)){
  886.         /* we want to get scale values into the preset memory */
  887.         getAllLumaScaleValues(&LumaPreB);
  888.         /* undo set state:*/
  889.         XmToggleButtonSetState(LumasetTB, False, True);
  890.     }
  891.     else{
  892.         /* we want to set scale values according to the preset memory */
  893.         setAllLumaScaleValues(LumaPreB);
  894.         /* set the VL controls */
  895.         doluma(DO_ALL);
  896.     }
  897. }
  898.  
  899. void
  900. luma1PBHandler(w, client, call)
  901. Widget w;
  902. XtPointer client;
  903. XtPointer call;
  904. {
  905.     XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
  906.     if (XmToggleButtonGetState(LumasetTB)){
  907.         /* we want to get scale values into the preset memory */
  908.         getAllLumaScaleValues(&LumaPre1);
  909.         /* undo set state:*/
  910.         XmToggleButtonSetState(LumasetTB, False, True);
  911.     }
  912.     else{
  913.         /* we want to set scale values according to the preset memory */
  914.         setAllLumaScaleValues(LumaPre1);
  915.         /* set the VL controls */
  916.         doluma(DO_ALL);
  917.     }
  918. }
  919.  
  920. void
  921. luma2PBHandler(w, client, call)
  922. Widget w;
  923. XtPointer client;
  924. XtPointer call;
  925. {
  926.     XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
  927.     if (XmToggleButtonGetState(LumasetTB)){
  928.         /* we want to get scale values into the preset memory */
  929.         getAllLumaScaleValues(&LumaPre2);
  930.         /* undo set state:*/
  931.         XmToggleButtonSetState(LumasetTB, False, True);
  932.     }
  933.     else{
  934.         /* we want to set scale values according to the preset memory */
  935.         setAllLumaScaleValues(LumaPre2);
  936.         /* set the VL controls */
  937.         doluma(DO_ALL);
  938.     }
  939. }
  940.  
  941. void
  942. luma3PBHandler(w, client, call)
  943. Widget w;
  944. XtPointer client;
  945. XtPointer call;
  946. {
  947.     XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
  948.     if (XmToggleButtonGetState(LumasetTB)){
  949.         /* we want to get scale values into the preset memory */
  950.         getAllLumaScaleValues(&LumaPre3);
  951.         /* undo set state:*/
  952.         XmToggleButtonSetState(LumasetTB, False, True);
  953.     }
  954.     else{
  955.         /* we want to set scale values according to the preset memory */
  956.         setAllLumaScaleValues(LumaPre3);
  957.         /* set the VL controls */
  958.         doluma(DO_ALL);
  959.     }
  960. }
  961.  
  962. void
  963. luma4PBHandler(w, client, call)
  964. Widget w;
  965. XtPointer client;
  966. XtPointer call;
  967. {
  968.     XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
  969.     if (XmToggleButtonGetState(LumasetTB)){
  970.         /* we want to get scale values into the preset memory */
  971.         getAllLumaScaleValues(&LumaPre4);
  972.         /* undo set state:*/
  973.         XmToggleButtonSetState(LumasetTB, False, True);
  974.     }
  975.     else{
  976.         /* we want to set scale values according to the preset memory */
  977.         setAllLumaScaleValues(LumaPre4);
  978.         /* set the VL controls */
  979.         doluma(DO_ALL);
  980.     }
  981. }
  982.  
  983. void
  984. lumasetTBHandler(w, client, call)
  985. Widget w;
  986. XtPointer client;
  987. XtPointer call;
  988. {
  989.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  990. }
  991.  
  992.  
  993. void
  994. /* put everything into all bg or all fg (up to the caller) using luma */
  995. prepswitch(allbackground)
  996. int allbackground;
  997. {
  998.      VLControlValue vlctlval;
  999.      VLControlValue vlgotval;
  1000.      int lumavals[4];
  1001.      int allval;
  1002.  
  1003.     lumavals[0] = lumavals[1] = 0;
  1004.     if (allbackground == 1) /* want all bg */
  1005.     {
  1006.       lumavals[2] = -8; lumavals[3] = 0;
  1007.     }
  1008.     else /* want all fg */
  1009.     {
  1010.     lumavals[2] = 7; lumavals[3] = 255;
  1011.     }
  1012.     setAllLumaVLValues(lumavals); 
  1013.     vlctlval.intVal = VL_EV1_KEYERMODE_LUMA;
  1014.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_KEYER_MODE, &vlctlval); 
  1015. }
  1016.  
  1017. void
  1018. doswitchloop(min,max,speed,axis,endstate)
  1019. int min;
  1020. int max;
  1021. int speed;
  1022. int axis;
  1023. {
  1024.     VLControlValue vlctlval;
  1025.     int i;
  1026.  
  1027.     vlctlval.fractVal.denominator = 1000;
  1028.     vlctlval.intVal = VL_EV1_KEYERMODE_SPATIAL;    
  1029.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_KEYER_MODE, &vlctlval);
  1030.         for (i = min; i <= max; i+= speed)
  1031.     {
  1032.     vlctlval.fractVal.numerator = i;
  1033.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_POSN,&vlctlval);
  1034.     if (axis == 2 )
  1035.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_POSN_PERP,&vlctlval);
  1036.     }    
  1037.     /* make sure wipe completes to clean end point: */
  1038.  
  1039.     vlctlval.intVal = 7;
  1040.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
  1041.     if (endstate == 0)
  1042.       prepswitch(1);
  1043.     else
  1044.       prepswitch(2);
  1045. }
  1046.  
  1047. void
  1048. doswitchloop2(min,max,speed,axis,endstate)
  1049. int min;
  1050. int max;
  1051. int speed;
  1052. int axis;
  1053. {
  1054.     VLControlValue vlctlval;
  1055.     int i;
  1056.  
  1057.     vlctlval.fractVal.denominator = 1000;
  1058.     vlctlval.intVal = VL_EV1_KEYERMODE_SPATIAL;    
  1059.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_KEYER_MODE, &vlctlval);
  1060.      for (i = max; i >= min; i-= speed)
  1061.     {
  1062.     vlctlval.fractVal.numerator = i;
  1063.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_POSN,&vlctlval);
  1064.     if (axis == 2 )
  1065.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_POSN_PERP,&vlctlval);
  1066.     }    
  1067.     /* make sure wipe completes to clean end point: */
  1068.  
  1069.     vlctlval.intVal = 7;
  1070.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
  1071.     if (endstate == 0)
  1072.       prepswitch(1);
  1073.     else
  1074.       prepswitch(2);
  1075. }
  1076.  
  1077. void
  1078. doleftrightswitch()
  1079. {
  1080.     VLControlValue vlctlval;
  1081.     VLControlValue vlgotval;
  1082.     int i, max, speed, switchpos;
  1083.  
  1084.     SwitchType = 1;
  1085.     vlctlval.fractVal.denominator = 1000;
  1086.  
  1087.     vlctlval.intVal = 1;
  1088.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
  1089.  
  1090.     vlctlval.intVal = VL_EV1_WIPETYPE_SINGLE;
  1091.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
  1092.     vlctlval.intVal = VL_EV1_WIPEANGLE_SE;
  1093.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
  1094.     vlctlval.fractVal.numerator = 0;
  1095.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
  1096.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
  1097.     vlctlval.intVal = 0;
  1098.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
  1099.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
  1100.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
  1101.     vlctlval.intVal = -8+(15*fuzzfactor/100);
  1102.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
  1103.     if (Automanualswitch)
  1104.     {
  1105.         max = 1000;
  1106.         /* note: 3 or 4 good default value */
  1107.         speed = 1+(int)(5*speedfactor/100);
  1108.         doswitchloop(0,max,speed,1,1); /* min,max,speed,axis,endstate */
  1109.     }else
  1110.     {
  1111.         XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
  1112.         vlctlval.fractVal.numerator = 10*switchpos; /* do wipe at posn */
  1113.         vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
  1114.     }
  1115. }
  1116.  
  1117. void
  1118. leftrightswitchPBHandler(w, client, call)
  1119. Widget w;
  1120. XtPointer client;
  1121. XtPointer call;
  1122. {
  1123.     XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
  1124.     doleftrightswitch();
  1125. }
  1126.  
  1127.  
  1128. doelevatorhorizswitch()
  1129. {
  1130.     VLControlValue vlctlval;
  1131.     int i, min, max, speed, switchpos;
  1132.  
  1133.     SwitchType = 2;
  1134.     vlctlval.fractVal.denominator = 1000;
  1135.  
  1136.     vlctlval.intVal = 1;
  1137.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
  1138.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
  1139.  
  1140.     vlctlval.intVal = VL_EV1_WIPETYPE_SINGLE;
  1141.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
  1142.     vlctlval.intVal = VL_EV1_WIPEANGLE_N;
  1143.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
  1144.     vlctlval.fractVal.numerator = 500;
  1145.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
  1146.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
  1147.     vlctlval.intVal = 0;
  1148.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
  1149.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
  1150.     vlctlval.intVal = -8+(15*fuzzfactor/100);
  1151.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
  1152.     if (Automanualswitch)
  1153.     {
  1154.         min = 400;
  1155.         max = 1000;
  1156.         speed = 1+(int)(5*speedfactor/100);
  1157.         doswitchloop(min,max,speed,1,1); /* min,max,speed,axis */
  1158.     }else
  1159.     {
  1160.         XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
  1161.         vlctlval.fractVal.numerator = 10*switchpos; /* do wipe at posn */
  1162.         vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
  1163.     }
  1164.  
  1165. }
  1166.  
  1167. void
  1168. elevatorhorizswitchPBHandler(w, client, call)
  1169. Widget w;
  1170. XtPointer client;
  1171. XtPointer call;
  1172. {
  1173.     XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
  1174.     doelevatorhorizswitch();
  1175. }
  1176.  
  1177. docrossswitch()
  1178. {
  1179.     VLControlValue vlctlval;
  1180.     int i, min, max, speed, switchpos;
  1181.  
  1182.     SwitchType = 3;
  1183.     vlctlval.fractVal.denominator = 1000;
  1184.  
  1185.     vlctlval.intVal = 1;
  1186.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
  1187.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
  1188.  
  1189.     vlctlval.intVal = VL_EV1_WIPETYPE_CORNER;
  1190.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
  1191.     vlctlval.intVal = VL_EV1_WIPEANGLE_SE;
  1192.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
  1193.     vlctlval.fractVal.numerator = 500;
  1194.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
  1195.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
  1196.     vlctlval.intVal = 0;
  1197.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
  1198.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
  1199.     vlctlval.intVal = -8+(15*fuzzfactor/100);
  1200.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
  1201.     if (Automanualswitch)
  1202.     {
  1203.         min = 400;
  1204.         max = 1000;
  1205.         speed = 1+(int)(8*speedfactor/100);
  1206.         doswitchloop(min,max,speed,2,1); /* min,max,speed,axis,endstate */
  1207.     }else
  1208.     {
  1209.         XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
  1210.         vlctlval.fractVal.numerator = 10*switchpos; /* do wipe at posn */
  1211.         vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
  1212.     }
  1213.  
  1214. }
  1215. void
  1216. crossswitchPBHandler(w, client, call)
  1217. Widget w;
  1218. XtPointer client;
  1219. XtPointer call;
  1220. {
  1221.     XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
  1222.     docrossswitch();
  1223. }
  1224.  
  1225. dorectoutswitch()
  1226. {
  1227.     VLControlValue vlctlval;
  1228.     int i, min, max, speed, switchpos;
  1229.  
  1230.     SwitchType = 4;
  1231.     vlctlval.fractVal.denominator = 1000;
  1232.  
  1233.     vlctlval.intVal = VL_EV1_WIPETYPE_CORNER;
  1234.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
  1235.     vlctlval.intVal = VL_EV1_WIPEANGLE_NE;
  1236.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
  1237.     vlctlval.fractVal.numerator = 500;
  1238.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
  1239.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
  1240.     vlctlval.intVal = 0;
  1241.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
  1242.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
  1243.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
  1244.     vlctlval.intVal = 1;
  1245.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
  1246.     vlctlval.intVal = -8+(15*fuzzfactor/100);
  1247.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
  1248.     if (Automanualswitch)
  1249.     {
  1250.         min = 0;
  1251.         max = 500;
  1252.         speed = 1+(int)(5*speedfactor/100);
  1253.         doswitchloop(min,max,speed,2,0); /* min,max,speed,axis,endstate */
  1254.     }else
  1255.     {
  1256.         XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
  1257.         vlctlval.fractVal.numerator = 10*switchpos; /* do wipe at posn */
  1258.         vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
  1259.     }
  1260.  
  1261. }
  1262. void
  1263. rectoutswitchPBHandler(w, client, call)
  1264. Widget w;
  1265. XtPointer client;
  1266. XtPointer call;
  1267. {
  1268.     XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
  1269.     dorectoutswitch();
  1270. }
  1271.  
  1272. void
  1273. doupperleftswitch()
  1274. {
  1275.     VLControlValue vlctlval;
  1276.     int i,min, max, speed, switchpos;
  1277.  
  1278.     SwitchType = 5;
  1279.     vlctlval.fractVal.denominator = 1000;
  1280.  
  1281.     vlctlval.intVal = VL_EV1_WIPETYPE_CORNER;
  1282.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
  1283.     vlctlval.intVal = VL_EV1_WIPEANGLE_SE;
  1284.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
  1285.     vlctlval.fractVal.numerator = 0;
  1286.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
  1287.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
  1288.     vlctlval.intVal = 0;
  1289.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
  1290.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
  1291.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
  1292.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
  1293.     vlctlval.intVal = -8+(15*fuzzfactor/100);
  1294.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
  1295.     if (Automanualswitch)
  1296.     {
  1297.         max = 1000;
  1298.         speed = 1+(int)(8*speedfactor/100);
  1299.         doswitchloop(0,max,speed,1,0); /* min,max,speed,axis,endstate */
  1300.     }else
  1301.     {
  1302.         XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
  1303.         vlctlval.fractVal.numerator = 10*switchpos; /* do wipe at posn */
  1304.         vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
  1305.     }
  1306.  
  1307. }
  1308.  
  1309. void
  1310. upperleftswitchPBHandler(w, client, call)
  1311. Widget w;
  1312. XtPointer client;
  1313. XtPointer call;
  1314. {   
  1315.     XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
  1316.     doupperleftswitch();
  1317. }
  1318.  
  1319. dosquaresswitch()
  1320. {
  1321.     VLControlValue vlctlval;
  1322.     int i,min, max, speed, switchpos;
  1323.  
  1324.     SwitchType = 6;
  1325.     vlctlval.fractVal.denominator = 1000;
  1326.  
  1327.     vlctlval.intVal = VL_EV1_WIPETYPE_DOUBLE;    
  1328.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
  1329.     vlctlval.intVal = VL_EV1_WIPEANGLE_NE;
  1330.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
  1331.     vlctlval.fractVal.numerator = 0;
  1332.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
  1333.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
  1334.     vlctlval.intVal = 1+(4*repeatfactor/100);
  1335.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
  1336.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
  1337.     vlctlval.intVal = 1;
  1338.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
  1339.     vlctlval.intVal = 0;
  1340.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
  1341.     vlctlval.intVal = -8+(15*fuzzfactor/100);
  1342.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
  1343.     if (Automanualswitch)
  1344.     {
  1345.        max = 1000;
  1346.        speed = 1+(int)(9*speedfactor/100);
  1347.        doswitchloop(0,max,speed,2,0);
  1348.     }else
  1349.     {
  1350.         XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
  1351.         vlctlval.fractVal.numerator = 10*switchpos; /* do wipe at posn */
  1352.         vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
  1353.         vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN_PERP,&vlctlval);
  1354.     }
  1355. }
  1356.  
  1357. void
  1358. squaresswitchPBHandler(w, client, call)
  1359. Widget w;
  1360. XtPointer client;
  1361. XtPointer call;
  1362. {
  1363.     XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
  1364.     dosquaresswitch();
  1365. }
  1366.  
  1367. dotilesswitch()
  1368. {
  1369.     VLControlValue vlctlval;
  1370.     int i,min, max, speed, switchpos;
  1371.  
  1372.     SwitchType = 7;
  1373.     vlctlval.fractVal.denominator = 1000;
  1374.  
  1375.     vlctlval.intVal = 1;
  1376.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
  1377.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
  1378.  
  1379.     vlctlval.intVal = VL_EV1_WIPETYPE_TILE;    
  1380.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
  1381.     vlctlval.intVal = VL_EV1_WIPEANGLE_NE;
  1382.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
  1383.     vlctlval.fractVal.numerator = 0;
  1384.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
  1385.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
  1386.     vlctlval.intVal = 1+(4*repeatfactor/100);
  1387.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
  1388.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
  1389.     vlctlval.intVal = -8+(15*fuzzfactor/100);
  1390.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
  1391.     if (Automanualswitch)
  1392.     {
  1393.        max = 1000;
  1394.        speed = 1+(int)(9*speedfactor/100);
  1395.        doswitchloop2(0,max,speed,2,0);
  1396.     }else
  1397.     {
  1398.         XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
  1399.         vlctlval.fractVal.numerator = (1000-10*switchpos); /* do wipe */
  1400.         vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
  1401.         vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN_PERP,&vlctlval);
  1402.     }
  1403. }
  1404.  
  1405. void
  1406. tilesswitchPBHandler(w, client, call)
  1407. Widget w;
  1408. XtPointer client;
  1409. XtPointer call;
  1410. {
  1411.     XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
  1412.     dotilesswitch();
  1413. }
  1414.  
  1415. dofadeswitch()
  1416. {
  1417.     VLControlValue vlctlval;
  1418.     int i,min, max, speed, switchpos;
  1419.  
  1420.     SwitchType = 8;
  1421.     vlctlval.fractVal.denominator = 1000;
  1422.  
  1423.     vlctlval.intVal = 1;
  1424.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
  1425.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
  1426.  
  1427.     vlctlval.intVal = VL_EV1_WIPETYPE_FADE;    
  1428.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
  1429.     vlctlval.intVal = VL_EV1_WIPEANGLE_NE;
  1430.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
  1431.     vlctlval.fractVal.numerator = 0;
  1432.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
  1433.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
  1434.     vlctlval.intVal = 3;
  1435.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
  1436.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
  1437.     vlctlval.intVal = -8+(15*fuzzfactor/100);
  1438.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
  1439.     if (Automanualswitch)
  1440.     {
  1441.        max = 1000;
  1442.        speed = 1+(int)(10*speedfactor/100);
  1443.        doswitchloop2(0,max,speed,2,0);
  1444.     }else
  1445.     {
  1446.         XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
  1447.         vlctlval.fractVal.numerator = 10*switchpos; /* do wipe at posn */
  1448.         vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
  1449.     }
  1450. }
  1451.  
  1452. void
  1453. fadeswitchPBHandler(w, client, call)
  1454. Widget w;
  1455. XtPointer client;
  1456. XtPointer call;
  1457. {
  1458.     XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
  1459.     dofadeswitch();
  1460. }
  1461.  
  1462. void
  1463. automanualTBHandler(w, client, call)
  1464. Widget w;
  1465. XtPointer client;
  1466. XtPointer call;
  1467. {
  1468.     XmToggleButtonCallbackStruct *cs=(XmToggleButtonCallbackStruct*)call;
  1469.     
  1470.     if (cs->set)
  1471.     {
  1472.          Automanualswitch = True;
  1473.     }
  1474.     else
  1475.     {
  1476.          Automanualswitch = False;
  1477.     }
  1478. }
  1479.  
  1480. void
  1481. switchspeedScaleHandler(w, client, call)
  1482. Widget w;
  1483. XtPointer client;
  1484. XtPointer call;
  1485. {
  1486.     XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
  1487.     speedfactor = cs->value;
  1488. }
  1489.  
  1490. void
  1491. fuzzScaleHandler(w, client, call)
  1492. Widget w;
  1493. XtPointer client;
  1494. XtPointer call;
  1495. {
  1496.     XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
  1497.     fuzzfactor = cs->value;
  1498. }
  1499.  
  1500. void
  1501. manualScaleHandler(w, client, call)
  1502. Widget w;
  1503. XtPointer client;
  1504. XtPointer call;
  1505. {
  1506.     XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
  1507.     VLControlValue vlctlval;
  1508.  
  1509.     vlctlval.intVal = VL_EV1_KEYERMODE_SPATIAL;    
  1510.     vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_KEYER_MODE, &vlctlval);
  1511.     if (!Automanualswitch)
  1512.     {
  1513.         switch (SwitchType)
  1514.         {   
  1515.         case 1:
  1516.             doleftrightswitch();
  1517.         break;
  1518.         case 2:
  1519.             doelevatorhorizswitch();
  1520.         break;
  1521.         case 3:
  1522.             docrossswitch();
  1523.         break;
  1524.         case 4:
  1525.             dorectoutswitch();
  1526.         break;
  1527.         case 5:
  1528.             doupperleftswitch();
  1529.         break;
  1530.         case 6:
  1531.             dosquaresswitch();
  1532.         break;
  1533.         case 7:
  1534.             dotilesswitch();
  1535.         break;
  1536.         case 8:
  1537.             dofadeswitch();
  1538.         break;
  1539.         }
  1540.     }
  1541. }
  1542.  
  1543. void
  1544. repeatScaleHandler(w, client, call)
  1545. Widget w;
  1546. XtPointer client;
  1547. XtPointer call;
  1548. {
  1549.     XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
  1550.     repeatfactor = cs->value;
  1551. }
  1552.  
  1553. void
  1554. util1PBHandler(w, client, call)
  1555. Widget w;
  1556. XtPointer client;
  1557. XtPointer call;
  1558. {
  1559.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  1560.     system("./util1.sh\n");
  1561. }
  1562.  
  1563. void
  1564. util2PBHandler(w, client, call)
  1565. Widget w;
  1566. XtPointer client;
  1567. XtPointer call;
  1568. {
  1569.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  1570.     system("./util2.sh\n");
  1571. }
  1572.  
  1573. void
  1574. helpPBHandler(w, client, call)
  1575. Widget w;
  1576. XtPointer client;
  1577. XtPointer call;
  1578. {
  1579.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  1580.     system("./help.sh\n");
  1581. }
  1582.  
  1583. void
  1584. quitPBHandler(w, client, call)
  1585. Widget w;
  1586. XtPointer client;
  1587. XtPointer call;
  1588. {
  1589.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  1590.     if (Version_number < 2.0){
  1591.         system("killall mychroma\n");
  1592.         system("killall myswitch\n");
  1593.     }
  1594.     docleanup();
  1595. }
  1596.  
  1597. void
  1598. option1PBHandler(w, client, call)
  1599. Widget w;
  1600. XtPointer client;
  1601. XtPointer call;
  1602. {
  1603.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  1604.     /* this option button used to redisplay widgets */
  1605.     if (Version_number < 2.0) {
  1606.         system("mychroma &\n");
  1607.         system("myswitch &\n");
  1608.         }
  1609.     else{
  1610.         XtManageChild(ChromaBBoard);
  1611.         XtPopup(XtParent(ChromaBBoard), XtGrabNone);
  1612.         XtManageChild(LumaBBoard);
  1613.         XtPopup(XtParent(LumaBBoard), XtGrabNone);
  1614.         XtManageChild(SwitchBBoard);
  1615.         XtPopup(XtParent(SwitchBBoard), XtGrabNone);
  1616.     }
  1617. }
  1618.  
  1619. void
  1620. app1PBHandler(w, client, call)
  1621. Widget w;
  1622. XtPointer client;
  1623. XtPointer call;
  1624. {
  1625.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  1626.     system("./app1.sh\n");
  1627. }
  1628.  
  1629. void
  1630. app2PBHandler(w, client, call)
  1631. Widget w;
  1632. XtPointer client;
  1633. XtPointer call;
  1634. {
  1635.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  1636.     system("./app2.sh\n");
  1637. }
  1638.  
  1639. void
  1640. app3PBHandler(w, client, call)
  1641. Widget w;
  1642. XtPointer client;
  1643. XtPointer call;
  1644. {
  1645.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  1646.     system("./app3.sh\n");
  1647. }
  1648.  
  1649. void
  1650. app4PBHandler(w, client, call)
  1651. Widget w;
  1652. XtPointer client;
  1653. XtPointer call;
  1654. {
  1655.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  1656.     system("./app4.sh\n");
  1657. }
  1658.  
  1659. void
  1660. app5PBHandler(w, client, call)
  1661. Widget w;
  1662. XtPointer client;
  1663. XtPointer call;
  1664. {
  1665.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  1666.     system("./app5.sh\n");
  1667. }
  1668.  
  1669. void
  1670. app6PBHandler(w, client, call)
  1671. Widget w;
  1672. XtPointer client;
  1673. XtPointer call;
  1674. {
  1675.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  1676.     system("./app6.sh\n");
  1677. }
  1678.  
  1679. void
  1680. grabnsavePBHandler(w, client, call)
  1681. Widget w;
  1682. XtPointer client;
  1683. XtPointer call;
  1684. {
  1685.     char cmd[50];
  1686.  
  1687.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  1688.     sprintf(cmd, "./grabnsave.sh %d", ev1num);
  1689.     system(cmd);
  1690. }
  1691.  
  1692. void
  1693. grabndispPBHandler(w, client, call)
  1694. Widget w;
  1695. XtPointer client;
  1696. XtPointer call;
  1697. {
  1698.     char cmd[50];
  1699.  
  1700.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  1701.     sprintf(cmd, "./grabndisp.sh %d", ev1num);
  1702.     system(cmd);
  1703. }
  1704.  
  1705. void
  1706. vidovergfxPBHandler(w, client, call)
  1707. Widget w;
  1708. XtPointer client;
  1709. XtPointer call;
  1710. {
  1711.     XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
  1712.     VLControlValue vlctlvalue;    
  1713.     VLControlValue gotvalue;    
  1714.  
  1715. #ifdef DEBUG
  1716.     printf("vid/gfx callback\n");
  1717. #endif
  1718.     vlctlvalue.intVal = src_vid;
  1719. #ifdef DEBUG
  1720.     printf("src_vid value %d\n", vlctlvalue.intVal);
  1721. #endif
  1722.     if (vlSetControl(vlSvr, vlPath, blend_node, 
  1723.         VL_BLEND_A, &vlctlvalue)<0)
  1724.         {
  1725.         vlPerror("Setting blend A ");
  1726.         exit(1);
  1727.         }
  1728.     vlGetControl(vlSvr, vlPath, blend_node, 
  1729.         VL_BLEND_A, &gotvalue);
  1730. #ifdef DEBUG
  1731.     printf("blend a (fg) set to %d\n", gotvalue.intVal);
  1732. #endif
  1733.     vlctlvalue.intVal = src_scr;
  1734. #ifdef DEBUG
  1735.     printf("src_scr value %d\n", vlctlvalue.intVal);
  1736. #endif
  1737.     if (vlSetControl(vlSvr, vlPath, blend_node, 
  1738.         VL_BLEND_B, &vlctlvalue)<0)
  1739.         {
  1740.         vlPerror("Setting blend B ");
  1741.         exit(1);
  1742.         }
  1743.     vlGetControl(vlSvr, vlPath, blend_node, 
  1744.         VL_BLEND_B, &gotvalue);
  1745. #ifdef DEBUG
  1746.     printf("blend a (bg) set to %d\n", gotvalue.intVal);
  1747. #endif
  1748.     vlGetControl(vlSvr, vlPath, blend_node, 
  1749.         VL_EV1_KEYER_MODE, &gotvalue);
  1750.     if (gotvalue.intVal == VL_EV1_KEYERMODE_LUMA)
  1751.         doluma(DO_ALL);
  1752.     else
  1753.     if (gotvalue.intVal == VL_EV1_KEYERMODE_CHROMA)
  1754.         dochroma(DO_ALL);
  1755. }
  1756.  
  1757. void
  1758. gfxovervidPBHandler(w, client, call)
  1759. Widget w;
  1760. XtPointer client;
  1761. XtPointer call;
  1762. {
  1763.     XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
  1764.     VLControlValue vlctlvalue;    
  1765.     VLControlValue gotvalue;    
  1766.     VLControlValue val;    
  1767.  
  1768.     vlctlvalue.intVal = src_scr;
  1769.     vlSetControl(vlSvr, vlPath, blend_node, 
  1770.         VL_BLEND_A, &vlctlvalue);
  1771.     vlctlvalue.intVal = src_vid;
  1772.     vlSetControl(vlSvr, vlPath, blend_node, 
  1773.         VL_BLEND_B, &vlctlvalue);
  1774.     vlGetControl(vlSvr, vlPath, blend_node, 
  1775.         VL_EV1_KEYER_MODE, &gotvalue);
  1776.     if (gotvalue.intVal == VL_EV1_KEYERMODE_LUMA)
  1777.         doluma(DO_ALL);
  1778.     else
  1779.     if (gotvalue.intVal == VL_EV1_KEYERMODE_CHROMA)
  1780.         dochroma(DO_ALL);
  1781.  
  1782.  
  1783. }
  1784.  
  1785.